import addr from '../apiConfig';
import { axios } from '../libs/axiosSetting';

 export async function login(params) {
    return axios({
      url: addr+'/login',
      method: 'post',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
      },
      data: params,
    });
  }

 export async function postUserRegister(params) {
    return axios({
      url: addr+'/register',
      method: 'post',
      data: params,
    });
  }

export async function postUserLogout() {
  return axios({
    url: addr+'/a/logout',
    method: 'get',
  });
}

 export async function getUserProfile() {
    return axios(`${addr}/a/user/profile`);
 }
 export function page(params) {
  return axios.get(addr+'/a/user/page', {
      params: params,
  });
}
export function update(params) {
  return axios({
    url: addr+'/a/user/update',
    method: 'post',
    data: params,
  });
}
export function insert(params) {
  return axios({
    url: addr+'/a/user/insert',
    method: 'post',
    data: params,
  });
} 
export function del(params) {
  return axios.get(addr+'/a/user/delete', {
      params: params,
  });
} 